#include<iostream>
#include<cstring>
using namespace std;

const int strsize = 20;

struct bop{
    char fullname[strsize]; // real name
    char title[strsize]; //    job title
    char bopname[strsize]; // secret BOP name
    int preference; // 0 = fullname,1 = title,2= bopname
};

int main()
{
    cout << "Benevolent Order of Programmers Report" << endl;
    cout << "a.display by name         b.display by title " << endl;
    cout << "c.display by bopname      d.display by preference " << endl;
    char choice;
    bop programmers[3] = 
    {
        {"name a","title a","bopname a",0},
        {"name b","title b","bopname b",1},
        {"name c","title c","bopname c",2},
    };
    cout << "a.display by name                   b.display by title\n"
            "c.display by bopname                d.display by preference\n"
            "q.quit\n";
    cout << "Enter yout choice:";
    cin >> choice;
    while ( choice != 'q')
    {
        switch(choice)
        {
            case 'a':
            for ( int i = 0; i < 3; i++)
            cout << programmers[i].fullname << endl;
            break;
            case 'b':
            for ( int i = 0; i < 3; i++)
            cout << programmers[i].title << endl;
            break;
            case 'c':
            for ( int i = 0; i < 3; i++)
            cout << programmers[i].bopname << endl;
            break;
            case 'd':
            for ( int i = 0; i < 3; i++)
            {
                int code = programmers[i].preference;
                switch(code)
                {
                    case 0:
                    cout << programmers[i].fullname << endl;
                    break;
                    case 1:
                    cout << programmers[i].title << endl;
                    break;
                    case 2:
                    cout << programmers[i].bopname << endl;
                    break;
                }
            }
            break;
        }
        cout << "Next choice:";
        cin >> choice;
    }
    cout << "Bye!" << endl;
    return 0;
}